package wisents.wicket;

import org.apache.wicket.util.tester.WicketTester;
import pl.rabbitsoftware.EnhancedWicketTester;
import wisents.api.factory.ElementCriteriaFactory;
import wisents.api.factory.Vendor;

/**
 * User: paul.szulc
 * Date: Dec 20, 2009
 * Time: 2:04:42 PM
 */
public class WicketVendor extends Vendor {

    private final WicketElementCriteriaFactory elementCriteriaFactory;

    private WicketTester tester;
    private EnhancedWicketTester enhancedTester;

    public WicketVendor() {
        this.elementCriteriaFactory = new WicketElementCriteriaFactory();
    }

    @Override
    public ElementCriteriaFactory createElementCriteriaFactory() {
        return elementCriteriaFactory;
    }

    public void setTesters(WicketTester tester) {
        this.tester = tester;
        this.enhancedTester = new EnhancedWicketTester(tester);
    }

    public WicketTester getTester() {
        return tester;
    }

    public EnhancedWicketTester getEnhancedTester() {
        return enhancedTester;
    }

    public static WicketVendor getWicketVendorInstance() {
        return (WicketVendor) Vendor.getInstance();
    }
}
